<?php

class fwPluginsAccountDb {
    function __construct() {
        
    }
    
    function createTableAccounts() {
        S::db()->query("
                CREATE TABLE IF NOT EXISTS `accounts` (
                  `id` int(10) NOT NULL AUTO_INCREMENT,
                  `login` varchar(50) NOT NULL,
                  `password` varchar(32) NOT NULL,
                  `email` varchar(100) DEFAULT NULL,
                  PRIMARY KEY (`id`,`login`,`password`),
                  UNIQUE KEY `id` (`id`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        ");
    }
    
    function createTableAccount_contacts() {
        S::db()->query("
                CREATE TABLE IF NOT EXISTS `account_contacts` (
                  `id` int(10) NOT NULL AUTO_INCREMENT,
                  PRIMARY KEY (`id`),
                  UNIQUE KEY `id` (`id`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        ");
    }
}